Dynomotion

Group: DynoMotion Message: 8382 From: Hugh Sontag Date: 9/20/2013
Subject: Fwd: [DynoMotion] Swapping motor leads


---------- Forwarded message ----------
From: Hugh Sontag <hsontag@...>
Date: Fri, Sep 20, 2013 at 12:11 PM
Subject: Re: [DynoMotion] Swapping motor leads
To: DynoMotion@yahoogroups.com


Thanks for your comments. Of course, I've created a positive feedback situation, and one motor was trying to run away. 

I think I'll swap the motor leads back and handle finding the index a little differently.

Hugh



On Thu, Sep 19, 2013 at 7:23 PM, Tom Kerekes <tk@...> wrote:
 

Hi Hugh,

The Encoder Position is really what determines which direction an axis moves.  For example if the axis is at position 0 and told to go to +100 then the servo should drive until the encoder reads +100.  So to reverse an axis direction you must reverse how the encoder counts.  You can do this in software by changing the InputGain0 parameter's sign (ie. from +1 t0 -1).

However if you have a working negative feedback system, and something in the feedback loop is reversed, the system will have positive feedback runaway (motor will drive the wrong way).  So something else like the Motor drive needs to be reversed also.

Swapping two motor leads will reverse the motor direction, but I'm not sure whether or not it introduces a commutation offset.   There wasn't really any need to swap motor leads because you could have just shifted the commutation by 1/2 cycle (180 degrees).

The simplest thing is to reverse the encoder direction in the AutoPhaseFind.c program by changing the line:

#define ENCODER_GAIN 1         // Set to -1 if desired to reverse axis direction

and then let it re-determine the commutation however the motor is currently wired.

HTH
Regards
TK